//
//  TestEvents.cpp
//  NanoOSX
//
//  Created by Jeppe Nielsen on 9/21/13.
//  Copyright (c) 2013 Jeppe Nielsen. All rights reserved.
//
#include "Event.hpp"
#include <iostream>

using namespace Nano;
using namespace std;

class Bomb {
public:
    void Explode() {
        Exploded(this);
    }
    Event<Bomb*> Exploded;
};


class BombManager {
public:
    void AddBomb(Bomb& bomb) {
        bomb.Exploded += event_handler(this, &BombManager::BombExploded);
    }
private:
    void BombExploded(Bomb* bomb) {
        cout<<"Bomb exploded"<<endl;
    }
};

/*
int main() {
    BombManager manager;
    Bomb bomb;
    manager.AddBomb(bomb);
    bomb.Explode();
    return 0;
}
*/


